package com.baizhi.controller;

import com.baizhi.entity.Exam;
import com.baizhi.service.ExamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class ExamController {
    @Autowired
    private ExamService examService;

    @RequestMapping("selectDrugAndExamByPage")
    @ResponseBody
    public Map selectDrugAndExamByPage(int page, int rows, String name){
        Map map=new HashMap();
        int total = examService.selectTotal(name);
        map.put("total",total);
        List<Exam> list = examService.selectDrugAndExamByPage(page, rows, name);
        map.put("rows",list);
        return map;
    }

}
